home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / c01oop.zip / ADAWKBK / SOL3-1.ADA < prev    next >
Text File  |  1992-08-25  |  530b  |  32 lines

  1. -- Problem 3.1
  2. -- by Rick Conn
  3. with Text_IO;
  4. procedure Main is
  5.  
  6.   package Int_IO is new Text_IO.Integer_IO (INTEGER);
  7.  
  8. begin
  9.  
  10.   declare
  11.     Sum : INTEGER := 0;
  12.  
  13.     procedure Display (Message : in STRING; Value : in INTEGER) is
  14.     begin
  15.       Text_IO.Put (Message & ": ");
  16.       Int_IO.Put (Value, 5);
  17.       Text_IO.New_Line;
  18.     end Display;
  19.  
  20.   begin -- block
  21.  
  22.     for I in 1 .. 10 loop
  23.  
  24.       Sum := Sum + I;
  25.       Display ("The sum so far is", Sum);
  26.  
  27.     end loop;
  28.  
  29.   end;  -- block
  30.  
  31. end Main; 
  32.